package com.prime.tutorial.moviestore.view.reports;

import com.prime.tutorial.moviestore.domain.Users;
import com.prime.tutorial.moviestore.service.reports.ReportsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.util.List;
/**
 * Provides the view level of the userActivity report.
 * @author vasylja
 */
@Component("userActivity")
@Scope("request")
public class UserActivityImpl {
    private ReportsService reportsService;
    private List<Users> listUserActivity;

    @Autowired
    public UserActivityImpl(ReportsService reportsService) {
        this.reportsService = reportsService;
        setListUserActivity(this.reportsService.getUserActivityReport());
    }

    public List<Users> getListUserActivity() {
        return listUserActivity;
    }

    private void setListUserActivity(List<Users> listUserActivity) {
        this.listUserActivity = listUserActivity;
    }
}
